package com.zf.yichat.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

@Table(name = "user_ip")
public class UserIp implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    private Long id;

    @Column(name = "user_id")
    private Long userId;

    /**
     * ip信息
     */
    private String ip;

    // 地区
    private String area;

    private Date ctime;

    // 0注册 1登录
    private String type;

    public UserIp(Long id, Long userId, String ip, String area, Date ctime, String type) {
        this.id = id;
        this.userId = userId;
        this.ip = ip;
        this.area = area;
        this.ctime = ctime;
        this.type = type;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public UserIp() {
        super();
    }

    /**
     * @return id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return user_id
     */
    public Long getUserId() {
        return userId;
    }

    /**
     * @param userId
     */
    public void setUserId(Long userId) {
        this.userId = userId;
    }

    /**
     * 获取ip信息
     *
     * @return ip - ip信息
     */
    public String getIp() {
        return ip;
    }

    /**
     * 设置ip信息
     *
     * @param ip ip信息
     */
    public void setIp(String ip) {
        this.ip = ip == null ? null : ip.trim();
    }

    /**
     * @return ctime
     */
    public Date getCtime() {
        return ctime;
    }

    /**
     * @param ctime
     */
    public void setCtime(Date ctime) {
        this.ctime = ctime;
    }
}